home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
mail.altrad.com
/
2015.02.mail.altrad.com.tar
/
mail.altrad.com
/
TEST
/
office german
/
OFFICE.DE-DE
/
OFFICELR.CAB
/
COLLECTSIGNATURES_INIT.XSN_1031
/
script.js
< prev
next >
Wrap
Text File
|
2006-10-26
|
4KB
|
104 lines
/*
* This file contains functions for data validation and form-level events.
* Because the functions are referenced in the form definition (.xsf) file,
* it is recommended that you do not modify the name of the function,
* or the name and number of arguments.
*
*/
// The following line is created by Microsoft Office InfoPath to define the prefixes
// for all the known namespaces in the main XML data file.
// Any modification to the form files made outside of InfoPath
// will not be automatically updated.
//<namespacesDefinition>
XDocument.DOM.setProperty("SelectionNamespaces", ' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:aml="http://schemas.microsoft.com/aml/2001/core" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:o12="http://schemas.microsoft.com/office/2004/7/core" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w12="http://schemas.microsoft.com/office/word/2004/6/wordml" xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint" xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml" xmlns:sl="http://schemas.microsoft.com/schemaLibrary/2003/core" xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD" xmlns:xd="http://schemas.microsoft.com/office/infopath/2003"');
//</namespacesDefinition>
function AddSigSpotNode(sigline)
{
sigSpotsNode = XDocument.DOM.selectSingleNode("//my:myFields/my:SignatureSpots");
elemSigSpot = XDocument.DOM.createNode(1, "my:SignatureSpot", "http://schemas.microsoft.com/office/infopath/2003/myXSD");
attribSigSpotID = XDocument.DOM.createNode(2, "my:SignatureSpotID", "http://schemas.microsoft.com/office/infopath/2003/myXSD");
attribSigSpotID.text = sigline.Setup.Id;
attribSuggSigner = XDocument.DOM.createNode(2, "my:SuggestedSigner", "http://schemas.microsoft.com/office/infopath/2003/myXSD");
attribSuggSigner.text = sigline.Setup.SuggestedSigner;
elemSigSpot.setAttributeNode(attribSigSpotID);
elemSigSpot.setAttributeNode(attribSuggSigner);
elemAssignee = XDocument.DOM.createNode(1, "my:Assignee", "http://schemas.microsoft.com/office/infopath/2003/myXSD");
suggSignerEmail = sigline.Setup.SuggestedSignerEmail;
if (suggSignerEmail)
{
elemPerson = XDocument.DOM.createNode(1, "my:Person", "http://schemas.microsoft.com/office/infopath/2003/myXSD");
elemPersonName = XDocument.DOM.createNode(1, "my:DisplayName", "http://schemas.microsoft.com/office/infopath/2003/myXSD");
elemPersonName.text = suggSignerEmail;
elemPerson.appendChild(elemPersonName);
elemAssignee.appendChild(elemPerson);
}
elemSigSpot.appendChild(elemAssignee);
sigSpotsNode.appendChild(elemSigSpot);
}
function compareSpots(a, b) { return a.SortHint - b.SortHint}
function AddSigSpotNodes(sigSpotsNode)
{
sigSpotsNode = XDocument.DOM.selectSingleNode("//my:myFields/my:SignatureSpots");
sigSpotNode = XDocument.DOM.selectSingleNode("//my:myFields/my:SignatureSpots/my:SignatureSpot");
sigSpotsNode.removeChild(sigSpotNode);
thisDoc = XDocument.Host;
thisDoc.Signatures.Subset = 2; //msoSignatureSubsetSignatureLines;
// Copy all the signature lines into an array.
cSigLines = thisDoc.Signatures.Count;
arrSigLines = new Array(cSigLines);
for (iSigLine = 1; iSigLine <= cSigLines; iSigLine++)
{
arrSigLines[iSigLine] = thisDoc.Signatures(iSigLine);
}
// Now sort the array based on the sort hint
arrSigLines.sort(compareSpots);
for (iSigLine = 0; iSigLine < cSigLines; iSigLine++)
{
thisSigLine = arrSigLines[iSigLine];
if (!thisSigLine.IsSignatureLine || (thisSigLine.IsSigned && thisSigLine.IsValid))
continue;
AddSigSpotNode(thisSigLine);
}
}
//=======
// The following function handler is created by Microsoft Office InfoPath.
// Do not modify the name of the function, or the name and number of arguments.
// This function is associated with the following field or group (XPath): /my:myFields/my:CC
// Note: Information in this comment is not updated after the function handler is created.
//=======
function XDocument::OnLoad(eventObj)
{
try
{
AddSigSpotNodes();
}
catch (e)
{
XDocument.UI.Alert(e.message);
}
}